
package codebreaker.cliente.conexao.gui;

import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JList;

/**
 *
 * @author rodrigo
 */
public class ListaServidorRenderer extends DefaultListCellRenderer {
    
    private static final ImageIcon icone =
	    new ImageIcon("img/servidor.png");
    
    
    public Component getListCellRendererComponent
	    (JList list, Object value, int index, boolean isSelected, boolean hasFocus) {
	
	JLabel label =
		(JLabel)super.getListCellRendererComponent(list, value, index, isSelected, hasFocus);
	
	label.setIcon(icone);
	
	return label;
    }
}
